﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for ControlContainer
/// </summary>
public class ControlContainer
{
	string _userControlPath;

	public string UserControlPath
	{
		get { return _userControlPath; }
		set { _userControlPath = value; }
	}
	string _title;

	public string Title
	{
		get { return _title; }
		set { _title = value; }
	}
	object _viewState;

	public object ViewState
	{
		get { return _viewState; }
		set { _viewState = value; }
	}

	Control _instance;

	public Control Instance
	{
		get { return _instance; }
		set { _instance = value; }
	}

	public ControlContainer()
	{
		//
		// TODO: Add constructor logic here
		//
	}

	public void SaveViewState()
	{
		IViewStatePersist persist = Instance as IViewStatePersist;

		if (persist != null)
		{
			ViewState = persist.SaveViewState();
		}
	}

	public void LoadViewState()
	{
		IViewStatePersist persist = Instance as IViewStatePersist;

		if (persist != null && ViewState != null)
		{
			persist.LoadViewState(ViewState);
		}
	}
}
